package chapter3.test1;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.context.WebApplicationContext;

public class Config {

    @Bean
    @Conditional(MagicExistsCondition.class)
    //@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Scope(value= WebApplicationContext.SCOPE_SESSION,proxyMode = ScopedProxyMode.INTERFACES)
    public MagicBean magicBean(){
        return new MagicBean();
    }

}
